package com.zy.ivideo.controller;

import com.zy.ivideo.entity.ResponseEntity;
import com.zy.ivideo.entity.VideoAuthorEntity;
import com.zy.ivideo.service.VideoAuthorService;
import com.zy.ivideo.token.PassToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/videoauthor")
@Api(value = "视频作者模块API接口", description = "该模块提供视频作者模块服务", tags = "视频作者模块")
public class VideoAuthorController {
    @Autowired
    VideoAuthorService service;

    /**
     * 通过userid获取对应作者信息
     * @param userid
     * @return
     */
    @PassToken
    @ApiOperation(value = "通过userid获取对应作者信息", notes = "通过userid获取对应作者信息", httpMethod = "GET")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(dataType = "String", name = "userid", value = "userid", required = true),
    })
    @GetMapping("/getAuthorById")
    public ResponseEntity<VideoAuthorEntity> getAuthorById(String userid){
       return service.getAuthorById(userid);
    }
}
